var rewire = require("rewire")
var tools = rewire('../common/tools.cjs')
var assert = require('assert')

(async function(){
  let i = 0
  async function ttt() {
    i = i + 1
  }

  const testF = tools.wrapCacheFn(ttt, 'testF', 10)

  await testF()
  await testF()
  await testF()

  assert.deepEqual(
    i,
    1,
    'tools.wrapCacheFn'
  )
})()
